import sequelize from "../../db/dbConnext";
import { option } from "../../db/commomConfig";
import { DataTypes } from "sequelize";
import SysRoleEntity from "../../../entities/system/SysRoleEntity";

export type ISysRole = Omit<SysRoleEntity, "validateThis" | "id">;

const SysRoleModel = sequelize.define<any, ISysRole>(
  "sys_role",
  {
    roleName: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    roleKey: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    roleSort: {
      type: DataTypes.INTEGER,
      allowNull: true,
    },
    dataScope: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    menuCheckStrictly: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    deptCheckStrictly: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    status: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    remark: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  },
  option
);
export default SysRoleModel;
